<form action="news.manage.php" method="get" name="form_search" id="form_search"  onsubmit="return ajax_search_list();">
<input type="hidden" name="action" id="action" value="ajax_news_search" />

<table border="0" cellpadding="0" cellspacing="0" class="from_table">
	<tr>
	<th width="34" align="center" valign="middle"> <tpl> $langSysNNewsName </tpl>
	 :</th>
	  <td width="420" align="left"><input type="text"  name="search_title" id="search_title" class="txtinput1" /></td>
	 
	 
	  <th width="60" align="left"><tpl> $langSysNClassName </tpl>
       :</th>
	  <td width="221" align="left">
	    <tpl> $slCId </tpl></td>
 	</tr>
 	<tr>
	<th width="34" align="center" valign="middle"><tpl> $langSysNNewsSort </tpl>
	 :</th>	
	<td width="420" align="left"> <tpl> $slOrder </tpl></td>

	<td colspan="2">
		<div style=" float:right; padding-right:30px;"><span class="btn_left" style="float:right">
		<input name="submit3" value="<tpl> $langSysNNewsSearch </tpl>" type="submit" class="btn_submit"/>
	  </span></div></td>
	
	</tr>
	
</table>

</form>

<form action="news.manage.php" id="form_del" name="form_del" method="post">
	<input type="hidden" name="action" id="action" value="del" />
<table  border="0" cellpadding="0" cellspacing="0" class="from_table2_one top-1">
	<thead>
		<tr class="area_ajax_list_title">
		  <th class="pd-left" width="10%" align="left" valign="middle"> 
		    <tpl> $langSysNSel </tpl>
		     </th>
		  <th width="40%" align="left" valign="middle">		    
		    <tpl> $langSysNNewsName </tpl>
		   </th>
		  <th width="30%" align="center" valign="middle">
		    <tpl> $langSysNNewsDate </tpl>
		     </th>
		  <th width="10%" align="center" valign="middle">
		    <tpl> $langSysNNewsSort </tpl>
		     </th>
		  <th width="10%" align="left" valign="middle">		    
		    <tpl> $langSysNManage </tpl>
		   </th>
		</tr>
	</thead>
	<tpl> if $news_array[0].news_id neq '' </tpl>
		<tpl> section name=i loop=$news_array </tpl>
		<tr>
		  <td class="pd-left" width="8%" align="left" valign="middle"> <input name="news_id[]" type="checkbox" value="<tpl> $news_array[i].news_id </tpl>"/></td>	
		  <td width="40%"  valign="middle"><tpl> $news_array[i].news_title </tpl></td>
		  <td width="30%"  valign="middle"><tpl> $news_array[i].news_date </tpl></td>
		  <td width="10%"  valign="middle"><tpl> $news_array[i].news_sort </tpl></td>
			<td width="10%"  valign="middle"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $news_array[i].news_id </tpl>');"title="<tpl> $langSysNEdit </tpl>" class="edit_a_pic">
		  </a>		  </td>
		</tr>
		<tpl> /section </tpl>
	
	<tpl> else  </tpl>
	<tr>
		<td colspan="6"><tpl> $langSysCNoThing </tpl></td>
	</tr>
	<tpl> /if </tpl>
</table>
<tpl> if $news_array[0].news_id neq '' </tpl>
<div class="table-5-bottom">
		<div style="float:left; padding-left:20px">
		<span class="btn_left">
			<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langSysNSelAll </tpl>" />
		  </span>
			<span class="btn_left">
			<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langSysNSelNegative </tpl>" />
			</span>
			<span class="btn_left">
			<input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langSysNDel </tpl>" />
			</span>		</div>
		<div style="float:right; padding-right:20px">
			<tpl> $page_list </tpl>		
		</div>		
	</div>
	<tpl> /if </tpl>
</form>

<div id="question" style="display:none; cursor: default; padding:10px"> 
	<b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langCConfirmDelete </tpl></b> <br />
	<input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
	<input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px;margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
</div> 
<script>
$(document).ready(function() {
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
		);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("news.manage.php?action=ajax_list<tpl>if $news_array|@count neq 1</tpl>&curpage=<tpl>$curpage</tpl><tpl>/if</tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
		$.unblockUI();
		$('#form_del').ajaxSubmit(options_del);	
		return false;
	});
	$('#no').click($.unblockUI);
});	

//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("news.manage.php?action=modi&id="+id+"&curpage=<tpl>$curpage</tpl>");
}
//搜索
function ajax_search_list(){
	/* 取表单参数 */var queryString=$("#form_search").formSerialize();
	
	$.ajax({
		url: "news.manage.php",
		data: queryString,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			$("#result_content").html(msg);
			hideLoading();
		}
	});
	return false;
}
</script>